package com.icinfo.cloud.provider.punish.fileoperation.controller;

import com.icinfo.cloud.provider.punish.fileoperation.service.IFileOperationService;
import com.icinfo.cloud.provider.punish.fileoperation.vo.PunishFileVisitVo;
import com.icinfo.framework.common.web.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 【V1.12.8】描述：文件操作接口前端控制器
 *
 * @Author zhengqiang
 * @Date 2023/10/26 10:36
 **/
@RestController
@RefreshScope
@RequestMapping("/app/file/operation")
@Slf4j
public class FileOperationController {

    @Resource
    private IFileOperationService fileOperationService;


    /**
     * 【V1.12.8】描述： 根据文件路径获取访问信息
     *
     * @return {@link Result< PunishFileVisitVo>}
     * @author: zhengqiang
     * @date: 2023/10/26
     * @param: fileUrl
     **/
    @GetMapping("/getFileVisitByFileUrl")
    public Result<PunishFileVisitVo> getFileVisitByFileUrl(@RequestParam("fileUrl") String fileUrl) {
        return fileOperationService.getFileVisitByFileUrl(fileUrl);
    }
}
